<!--
 * @Author: gy
 * @Date: 2020-07-02 09:13:18
 * @LastEditors  : gy
 * @LastEditTime : 2020-07-08 22:30:31
-->
<template>
    <div class="app-container">
        <div class="search-wrapper">
            <el-form :inline="true" class="demo-form-inline">
                <el-form-item label="类型名称">
                    <el-input
                        v-model="form.material_atype_name"
                        placeholder="请输入类型名称"
                    ></el-input>
                </el-form-item>
                <el-form-item label="创建时间">
                    <el-date-picker
                        v-model="form.createTime"
                        type="daterange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期"
                    >
                    </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="handleSearch"
                        >搜索</el-button
                    >
                    <el-button>重置</el-button>
                </el-form-item>
            </el-form>
        </div>
        <div class="list-wrapper">
            <div class="content">
                <div class="title">
                    <span>物料用量统计</span>
                </div>
                <div class="operation">
                    <el-button type="primary" @click="handleAdd"
                        >新增</el-button
                    >
                    <el-button>修改</el-button>
                    <el-button>删除</el-button>
                    <el-button>导出</el-button>
                </div>
                <comm-table
                    ref="comm-table"
                    :loading="loading"
                    :data="tableData"
                    style="width: 100%"
                >
                    <el-table-column width="80" type="selection" />
                    <el-table-column
                        prop="material_atype_name"
                        label="类型名称"
                        width="180"
                    />
                    <el-table-column
                        prop="material_atype_desc"
                        label="类型描述
"
                        width="180"
                    />
                    <el-table-column prop="create_by" label="创建人" />
                    <el-table-column prop="create_time" label="创建时间" />
                    <el-table-column prop="remark" label="备注" />
                </comm-table>
            </div>
        </div>
        <el-dialog
            :visible="dialogVisible"
            :title="title"
            @close="dialogVisible = false"
        >
            <AddStatistics ref="addDialog" />
            <div class="dialog-footer">
                <el-button @click="handleConfirm" type="primary"
                    >确认</el-button
                >
                <el-button @click="dialogVisible = false">取消</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
import AddStatistics from "../modules/add-statistics";
import TableCommMixin from "@/mixins/TableCommMixin";
import { postAction, getAction } from "@/api/manage";
export default {
    name: "MaterialType",
    mixins: [TableCommMixin],
    components:{AddStatistics},
    data() {
        return {
            form: {
                material_atype_name: "",
                createTime: ""
            },
            url: {
                list: "/material/api/MesMaterialAType",
                add: "/material/api/MesMaterialAType",
                addMethod: "post",
                edit: "/material/api/MesMaterialAType",
                editMethod: "put",
                delete: "/material/api/MesMaterialAType"
            }
        };
    },
    created() {},
    methods: {},
    mounted() {}
};
</script>
